package com.aliance.soo.board.controller;

import java.util.HashMap;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.aliance.soo.board.dao.BoardDao;
import com.aliance.soo.board.vo.BoardVo;

@Controller
public class BoardController {
	
	@RequestMapping("boardList")
	public ModelAndView boardList(@RequestParam(value="pageNum", defaultValue="1", required=false)String pageNum) {
		
			System.out.println("여긴 되나?");
			BoardDao boardDao = BoardDao.getInstance();
			System.out.println("여기는????");
			HashMap<String, Object> map = new HashMap<String, Object>();
			List<BoardVo> list = null;
			System.out.println("여기도???");
			list = boardDao.getBoardList(map);
			System.out.println("이짝은???");
			
			ModelAndView mav = new ModelAndView();
			mav.addObject("list", list);
			mav.setViewName("boardList");
			
			return mav;
	}

}
